package com.trace.pplos.parse.dao.dataobject;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Date;

public class CjcjInfo {
    private static final Logger logger = LoggerFactory.getLogger(CjcjInfo.class);

    private Integer id;

    private String billNo;

    private String scnType;

    private String title;

    private String times;

    private String addr;

    private String lng;

    private String lat;

    private String clue;

    private String repairWay;

    private String des;

    private String photoPath;

    private String voicePath;

    private String videoPath;

    private String voiceDisplayNames;

    private String videoDisplayNames;

    private String signalStation;

    private String synced;

    private String locMapSnapPath;

    private String caseRegPhotoPath;

    private String lngGps;

    private String latGps;

    private String cjdw;

    private String filepath;

    private String overviewImgPath;

    private String keypartsImgPath;

    private String breakdownImgPath;

    private String fingerPath;

    private String kctSignalStation;

    private Date kykssj;

    private Date kyjssj;

    private String tqzk;

    private String fx;

    private String wd;

    private String sd;

    private String hasYkcData;

    private Date gmtCreate;

    private String gmtCreateUser;

    private Date gmtModified;

    private String gmtModifiedUser;

    private Integer status;

    public CjcjInfo(Integer id, String billNo, String scnType, String title, String times, String addr, String lng, String lat, String clue, String repairWay, String des, String photoPath, String voicePath, String videoPath, String voiceDisplayNames, String videoDisplayNames, String signalStation, String synced, String locMapSnapPath, String caseRegPhotoPath, String lngGps, String latGps, String cjdw, String filepath, String overviewImgPath, String keypartsImgPath, String breakdownImgPath, String fingerPath, String kctSignalStation, Date kykssj, Date kyjssj, String tqzk, String fx, String wd, String sd, String hasYkcData, Date gmtCreate, String gmtCreateUser, Date gmtModified, String gmtModifiedUser, Integer status) {
        this.id = id;
        this.billNo = billNo;
        this.scnType = scnType;
        this.title = title;
        this.times = times;
        this.addr = addr;
        this.lng = lng;
        this.lat = lat;
        this.clue = clue;
        this.repairWay = repairWay;
        this.des = des;
        this.photoPath = photoPath;
        this.voicePath = voicePath;
        this.videoPath = videoPath;
        this.voiceDisplayNames = voiceDisplayNames;
        this.videoDisplayNames = videoDisplayNames;
        this.signalStation = signalStation;
        this.synced = synced;
        this.locMapSnapPath = locMapSnapPath;
        this.caseRegPhotoPath = caseRegPhotoPath;
        this.lngGps = lngGps;
        this.latGps = latGps;
        this.cjdw = cjdw;
        this.filepath = filepath;
        this.overviewImgPath = overviewImgPath;
        this.keypartsImgPath = keypartsImgPath;
        this.breakdownImgPath = breakdownImgPath;
        this.fingerPath = fingerPath;
        this.kctSignalStation = kctSignalStation;
        this.kykssj = kykssj;
        this.kyjssj = kyjssj;
        this.tqzk = tqzk;
        this.fx = fx;
        this.wd = wd;
        this.sd = sd;
        this.hasYkcData = hasYkcData;
        this.gmtCreate = gmtCreate;
        this.gmtCreateUser = gmtCreateUser;
        this.gmtModified = gmtModified;
        this.gmtModifiedUser = gmtModifiedUser;
        this.status = status;
    }

    public CjcjInfo() {
        super();
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getBillNo() {
        return billNo;
    }

    public void setBillNo(String billNo) {
        this.billNo = billNo == null ? null : billNo.trim();
    }

    public String getScnType() {
        return scnType;
    }

    public void setScnType(String scnType) {
        this.scnType = scnType == null ? null : scnType.trim();
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title == null ? null : title.trim();
    }

    public String getTimes() {
        return times;
    }

    public void setTimes(String times) {
        this.times = times == null ? null : times.trim();
    }

    public String getAddr() {
        return addr;
    }

    public void setAddr(String addr) {
        this.addr = addr == null ? null : addr.trim();
    }

    public String getLng() {
        return lng;
    }

    public void setLng(String lng) {
        this.lng = lng == null ? null : lng.trim();
    }

    public String getLat() {
        return lat;
    }

    public void setLat(String lat) {
        this.lat = lat == null ? null : lat.trim();
    }

    public String getClue() {
        return clue;
    }

    public void setClue(String clue) {
        this.clue = clue == null ? null : clue.trim();
    }

    public String getRepairWay() {
        return repairWay;
    }

    public void setRepairWay(String repairWay) {
        this.repairWay = repairWay == null ? null : repairWay.trim();
    }

    public String getDes() {
        return des;
    }

    public void setDes(String des) {
        this.des = des == null ? null : des.trim();
    }

    public String getPhotoPath() {
        return photoPath;
    }

    public void setPhotoPath(String photoPath) {
        this.photoPath = photoPath == null ? null : photoPath.trim();
    }

    public String getVoicePath() {
        return voicePath;
    }

    public void setVoicePath(String voicePath) {
        this.voicePath = voicePath == null ? null : voicePath.trim();
    }

    public String getVideoPath() {
        return videoPath;
    }

    public void setVideoPath(String videoPath) {
        this.videoPath = videoPath == null ? null : videoPath.trim();
    }

    public String getVoiceDisplayNames() {
        return voiceDisplayNames;
    }

    public void setVoiceDisplayNames(String voiceDisplayNames) {
        this.voiceDisplayNames = voiceDisplayNames == null ? null : voiceDisplayNames.trim();
    }

    public String getVideoDisplayNames() {
        return videoDisplayNames;
    }

    public void setVideoDisplayNames(String videoDisplayNames) {
        this.videoDisplayNames = videoDisplayNames == null ? null : videoDisplayNames.trim();
    }

    public String getSignalStation() {
        return signalStation;
    }

    public void setSignalStation(String signalStation) {
        this.signalStation = signalStation == null ? null : signalStation.trim();
    }

    public String getSynced() {
        return synced;
    }

    public void setSynced(String synced) {
        this.synced = synced == null ? null : synced.trim();
    }

    public String getLocMapSnapPath() {
        return locMapSnapPath;
    }

    public void setLocMapSnapPath(String locMapSnapPath) {
        this.locMapSnapPath = locMapSnapPath == null ? null : locMapSnapPath.trim();
    }

    public String getCaseRegPhotoPath() {
        return caseRegPhotoPath;
    }

    public void setCaseRegPhotoPath(String caseRegPhotoPath) {
        this.caseRegPhotoPath = caseRegPhotoPath == null ? null : caseRegPhotoPath.trim();
    }

    public String getLngGps() {
        return lngGps;
    }

    public void setLngGps(String lngGps) {
        this.lngGps = lngGps == null ? null : lngGps.trim();
    }

    public String getLatGps() {
        return latGps;
    }

    public void setLatGps(String latGps) {
        this.latGps = latGps == null ? null : latGps.trim();
    }

    public String getCjdw() {
        return cjdw;
    }

    public void setCjdw(String cjdw) {
        this.cjdw = cjdw == null ? null : cjdw.trim();
    }

    public String getFilepath() {
        return filepath;
    }

    public void setFilepath(String filepath) {
        this.filepath = filepath == null ? null : filepath.trim();
    }

    public String getOverviewImgPath() {
        return overviewImgPath;
    }

    public void setOverviewImgPath(String overviewImgPath) {
        this.overviewImgPath = overviewImgPath == null ? null : overviewImgPath.trim();
    }

    public String getKeypartsImgPath() {
        return keypartsImgPath;
    }

    public void setKeypartsImgPath(String keypartsImgPath) {
        this.keypartsImgPath = keypartsImgPath == null ? null : keypartsImgPath.trim();
    }

    public String getBreakdownImgPath() {
        return breakdownImgPath;
    }

    public void setBreakdownImgPath(String breakdownImgPath) {
        this.breakdownImgPath = breakdownImgPath == null ? null : breakdownImgPath.trim();
    }

    public String getFingerPath() {
        return fingerPath;
    }

    public void setFingerPath(String fingerPath) {
        this.fingerPath = fingerPath == null ? null : fingerPath.trim();
    }

    public String getKctSignalStation() {
        return kctSignalStation;
    }

    public void setKctSignalStation(String kctSignalStation) {
        this.kctSignalStation = kctSignalStation == null ? null : kctSignalStation.trim();
    }

    public Date getKykssj() {
        return kykssj;
    }

    public void setKykssj(Date kykssj) {
        this.kykssj = kykssj;
    }

    public Date getKyjssj() {
        return kyjssj;
    }

    public void setKyjssj(Date kyjssj) {
        this.kyjssj = kyjssj;
    }

    public String getTqzk() {
        return tqzk;
    }

    public void setTqzk(String tqzk) {
        this.tqzk = tqzk == null ? null : tqzk.trim();
    }

    public String getFx() {
        return fx;
    }

    public void setFx(String fx) {
        this.fx = fx == null ? null : fx.trim();
    }

    public String getWd() {
        return wd;
    }

    public void setWd(String wd) {
        this.wd = wd == null ? null : wd.trim();
    }

    public String getSd() {
        return sd;
    }

    public void setSd(String sd) {
        this.sd = sd == null ? null : sd.trim();
    }

    public String getHasYkcData() {
        return hasYkcData;
    }

    public void setHasYkcData(String hasYkcData) {
        this.hasYkcData = hasYkcData == null ? null : hasYkcData.trim();
    }

    public Date getGmtCreate() {
        return gmtCreate;
    }

    public void setGmtCreate(Date gmtCreate) {
        this.gmtCreate = gmtCreate;
    }

    public String getGmtCreateUser() {
        return gmtCreateUser;
    }

    public void setGmtCreateUser(String gmtCreateUser) {
        this.gmtCreateUser = gmtCreateUser == null ? null : gmtCreateUser.trim();
    }

    public Date getGmtModified() {
        return gmtModified;
    }

    public void setGmtModified(Date gmtModified) {
        this.gmtModified = gmtModified;
    }

    public String getGmtModifiedUser() {
        return gmtModifiedUser;
    }

    public void setGmtModifiedUser(String gmtModifiedUser) {
        this.gmtModifiedUser = gmtModifiedUser == null ? null : gmtModifiedUser.trim();
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }


    public static CjcjInfo toBean(String object){
        try{
            CjcjInfo info = new CjcjInfo();
            JSONObject record = JSON.parseObject(object);
            info.setScnType("0");
            info.setTitle(record.getString("ajmc"));
            info.setTimes(record.getString("createdAt"));
            info.setAddr(record.getString("address"));
            info.setLng(record.getString("longitude"));
            info.setLat(record.getString("latitude"));
            info.setDes(record.getString("ajms"));
            info.setGmtCreate(record.getDate("createdAt"));
            info.setGmtCreateUser(record.getString("createdBy"));
            info.setGmtModified(new Date());
            info.setGmtModifiedUser(record.getString("modifiedBy"));

            //音频资料
            String filePaths = "";
            JSONArray list = record.getJSONArray("voiceList");
            for (int i = 0; i < list.size(); i++) {
                JSONObject dataObj = list.getJSONObject(i);
                filePaths += dataObj.getString("path") +",";
            }
            info.setVoicePath(filePaths);

            //现场方位图
            filePaths = "";
            list = record.getJSONArray("xcfwPictureList");
            for (int i = 0; i < list.size(); i++) {
                JSONObject dataObj = list.getJSONObject(i);
                filePaths += dataObj.getString("path") +",";
            }
            info.setLocMapSnapPath(filePaths);

            //处警登记照片
            filePaths = "";
            list = record.getJSONArray("cjjlPictureList");
            for (int i = 0; i < list.size(); i++) {
                JSONObject dataObj = list.getJSONObject(i);
                filePaths += dataObj.getString("path") +",";
            }
            info.setCaseRegPhotoPath(filePaths);

            //概览图片
            filePaths = "";
            list = record.getJSONArray("glzpPictureList");
            for (int i = 0; i < list.size(); i++) {
                JSONObject dataObj = list.getJSONObject(i);
                filePaths += dataObj.getString("path") +",";
            }
            info.setOverviewImgPath(filePaths);

            //重点部位
            filePaths = "";
            list = record.getJSONArray("zdbwPictureList");
            for (int i = 0; i < list.size(); i++) {
                JSONObject dataObj = list.getJSONObject(i);
                filePaths += dataObj.getString("path") +",";
            }
            info.setKeypartsImgPath(filePaths);

            // 细目照片
            filePaths = "";
            list = record.getJSONArray("xmzpPictureList");
            for (int i = 0; i < list.size(); i++) {
                JSONObject dataObj = list.getJSONObject(i);
                filePaths += dataObj.getString("path") +",";
            }
            info.setBreakdownImgPath(filePaths);

            // 其它照片
            filePaths = "";
            list = record.getJSONArray("qtPictureList");
            for (int i = 0; i < list.size(); i++) {
                JSONObject dataObj = list.getJSONObject(i);
                filePaths += dataObj.getString("path") +",";
            }
            info.setPhotoPath(filePaths);

            return info;
        }catch (Exception e){
            logger.error(e.getMessage(), e);
        }
        return null;
    }
}